

/**
 * 游戏规则
 */
enum RuleType {
    jiawu = 1, qingyise, ting, jihujipiao, zangang, shoubayi, beikaobei, dianpaobaosanjia, zimojiadi, zimojiafan,
    dianganghua_pao, dianganghua_zimo, huansanzhang, yaojiujiangdui, menqingzhongzhang, tiandihu, xuezhandaodi, xueliuchenghe, fengding = 19,
    sanren_2 = 20, sanren_3, siren_2, paizhang, kaertiao,
    baijia = 101, chikaimen, menhu, baotingjiabei, baoyijia,
    qixiaodui = 120, piaohu,
    zhangmao = 130, xiganghu, quemenhu = 181,
    yipaoduoxiang = 171, daizhuang,
    dingxiangpiao = 191, xuanfenggang = 192,
    zhanli = 201, jiahu, caigang, menqing, diangangjiabei,
    jiang258 = 301, daifeng, daihua, baoting, minglou,
    siguiyi = 351,
    buzuozhang28 = 3301, gangkai, mingpiao, baopai, haidilao,
    shisanyao = 3601, diangang = 3603, gangshangpao = 3605,
    yikouxiang = 3801, huchiluanpeng, dianpaofanbei = 3804, xiazhuangkoulianzhuang, difen5 = 3809, difen10, difen15,
    gangsuizhuangzou = 4103,
    zhanting = 4705, gunbao, dailoude,
    difen = 4901, gouzhang = 4903, dunlapao, aazhi, fangzhuzhifu,
    qiangganghu = 5105,
    xiadan = 5505
}

/**
 * GameRules
 * @Author Ace.c
 * @Create 2016-12-26 10:52
 */
class GameRules {

    //规则
    static ruleText: any = {
        1: "夹五",
        2: "清一色",
        3: "扣听",
        4: "鸡胡鸡飘",
        5: "攒杠",
        6: "手把一",
        7: "背靠背",
        8: "点炮包三家",
        9: "自摸加底",
        10: "自摸加番",
        11: "点杠花(点炮)",
        12: "点杠花(自摸)",
        13: "换三张",
        14: "幺九将对",
        15: "门清中张",
        16: "天地胡",
        17: "血战到底",
        18: "血流成河",
        19: "封顶",
        20: "三人两房",
        21: "三人三房",
        22: "四人两房",
        23: "牌张",
        24: "卡二条",
        101: "摆夹",
        102: "吃开门",
        103: "闷胡",
        104: "报听加倍",
        105: "点炮包一家",
        120: "七小对",
        121: "飘胡",
        130: "长毛",
        131: "喜杠胡",
        171: "一炮多响",
        172: "带庄",
        181: "缺门胡",
        191: "定向飘",
        192: "旋风杠",
        201: "站立胡",
        202: "夹胡翻番",
        203: "彩杠",
        204: "抓闭门",
        205: "点杠加倍",
        301: "258将",
        302: "带风",
        303: "带花",
        304: "报听",
        305: "明搂",
        351: "四归一",
        3601: "十三幺",
        3603: "点杠",
        3605: "杠上炮",
        3801: "一口香",
        3802: "胡吃乱碰",
        3804: "点炮翻倍",
        3805: "下庄扣连庄",
        3806: "封顶100",
        3807: "封顶150",
        3808: "不封顶",
        3809: "底分5",
        3810: "底分10",
        3811: "底分15",
        4103: "杠随庄走",
        4705: "粘听",
        4706: "滚宝",
        4707: "带漏的",
        4901: "底分",
        4903: "够张",
        4904: "蹲拉跑",
        4905: "AA制",
        4906: "房主支付",
        5105: "抢杠胡",
        5505: "下蛋",
    };

    //胡牌文本
    static resultText(va: number) {
        let txt: string = "";
        switch (va) {
            case 6:
                txt = "庄家";
                break;
            case 7:
                txt = "自摸";
                break;
            case 8:
                txt = "站立";
                break;
            case 9:
                txt = "带鸡";
                break;
            case 10:
                txt = "夹胡";
                break;
            case 11://双飘
                txt = "飘胡";
                if (GameConfig.gameType == GameType.shenyang) txt = "双飘";
                if (GameConfig.gameType == GameType.hailun) txt = "小飘";
                if (GameConfig.gameType == GameType.bayan) txt = "对胡";
                break;
            case 12://单飘
                txt = "飘胡";
                if (GameConfig.gameType == GameType.shenyang) txt = "单飘";
                if (GameConfig.gameType == GameType.hailun) txt = "大飘";
                break;
            case 13:
                txt = "摸宝";
                break;
            case 14:
                txt = "宝中宝";
                break;
            case 15:
                txt = "通宝";
                break;
            case 16:
            case 3831:
                txt = "门清";
                break;
            case 17:
                txt = "点炮";
                if (GameConfig.gameType == GameType.bayan) txt = "黑炮";
                break;
            case 18:
                txt = "清一色";
                if (GameConfig.gameType == GameType.baishan) txt = "纯一色";
                break;
            case 19:
                txt = "杠上开花";
                if (GameConfig.gameType == GameType.baishan) txt = "杠上花";
                break;
            case 20:
                txt = "暗叫";
                break;
            case 21:
                txt = "扫底胡";
                break;
            case 24:
                txt = "暗杠";
                break;
            case 25:
                txt = "明杠";
                break;
            case 29:
                txt = "天胡";
                break;
            case 30:
                txt = "夹五";
                break;
            case 31:
                txt = "七对";
                if (GameConfig.gameType == GameType.bayan) txt = "小七对";
                break;
            case 33:
                txt = "将一色";
                break;
            case 34:
                txt = "中张";
                break;
            case 35:
                txt = "换三张";
                break;
            case 36:
                txt = "手把一";
                break;
            case 37:
                txt = "地胡";
                break;
            case 38:
                txt = "全幺九";
                break;
            case 39:
                txt = "过手杠";
                break;
            case 40:
                txt = "一炮多响";
                break;
            case 41:
                txt = "杠上炮";
                break;
            case 42:
                txt = "将七对";
                break;
            case 43:
                txt = "龙七对";
                break;
            case 44:
                txt = "抢杠胡";
                break;
            case 45:
                txt = "接炮";
                break;
            case 46:
                txt = "根儿";
                break;
            case 47:
                txt = "查大叫";
                break;
            case 48:
                txt = "卡二条";
                break;
            case 49:
                txt = "点杠";
                break;
            case 51:
            case 3830:
                txt = "海底炮";
                break;
            case 52:
                txt = "闷胡";
                break;
            case 53:
                txt = "报听";
                if (GameConfig.gameType == GameType.baishan) txt = "听牌";
                break;
            case 54:
                txt = "三清";
                break;
            case 55:
                txt = "四清";
                break;
            case 56:
                txt = "缺幺胡幺";
                break;
            case 57:
                txt = "漏胡";
                break;
            case 70:
                txt = "长毛";
                break;
            case 71:
                txt = "豪华七对";
                break;
            case 72:
                txt = "超级豪华七对";
                break;
            case 80:
                txt = "混一色";
                break;
            case 99:
                txt = "胡";
                if (GameConfig.gameType == GameType.baotou) txt = "成胡";
                if (GameConfig.gameType == GameType.hailun) txt = "平胡";
                break;
            case 101:
                txt = "一条龙";
                break;
            case 102:
                txt = "十三幺";
                break;
            case 151:
                txt = "定向漂";
                break;
            case 152:
            case 3829:
                txt = "四归一";
                break;
            case 341:
                txt = "财神";
                break;
            case 342:
                txt = "风碰";
                break;
            case 343:
                txt = "被跟庄";
                break;
            case 344:
                txt = "底花";
                break;
            case 345:
                txt = "花呲";
                break;
            case 346:
                txt = "荒庄";
                break;
            case 347:
                txt = "明搂";
                break;
            case 3602:
                txt = "十三幺";
                break;
            case 3812:
                txt = "底分+5";
                break;
            case 3813:
                txt = "底分+10";
                break;
            case 3814:
                txt = "底分+15";
                break;
            case 3815:
                txt = "捉五魁";
                break;
            case 3816:
                txt = "胡边";
                break;
            case 3817:
                txt = "胡坎";
                break;
            case 3818:
                txt = "单吊";
                break;
            case 3819:
                txt = "暗刻";
                break;
            case 3820:
            case 3835:
                txt = "连庄";
                break;
            case 3821:
                txt = "老少";
                break;
            case 3822:
                txt = "大连";
                break;
            case 3823:
                txt = "小连";
                break;
            case 3824:
                txt = "大高";
                break;
            case 3825:
                txt = "小高";
                break;
            case 3826:
                txt = "八张";
                break;
            case 3827:
                txt = "缺门";
                break;
            case 4101:
                txt = "一般高";
                break;
            case 4102:
                txt = "三同顺";
                break;
            case 4701:
                txt = "大风";
                break;
            case 4702:
                txt = "红中满天飞";
                break;
            case 5501:
                txt = "搂大风";
                break;
            case 5502:
                txt = "带红中";
                break;
            case 5503:
                txt = "宝风";
                break;
            case 5504:
                txt = "狂风";
                break;
        }
        return txt;
    }
}